<#include "/common/header.html" />

<body class="gray-bg">
    <div class="wrapper wrapper-content animated fadeInUp">
        <div class="row">
            <div class="col-sm-12">
                 <div class="ibox-content">
                 		<form method="post" action="updateAuth" 
                 		class="form-horizontal" id="updateAuthForm">
                            <div class="form-group">
                                <label class="col-sm-2 control-label">权限</label>
                                <div class="col-sm-10">
                                	<#list permList as perm>
                                        <label><input 
                                        ${(perm.isChecked > 0)?string('checked','')}
                                        type="checkbox" class="checkbox i-checks" value="${perm.id}" name="permId"> <i></i>${perm.name}</label>
                                	</#list>
                                </div>
                            </div>
                            <div class="hr-line-dashed"></div>
                            <div class="form-group">
                                <div class="col-sm-4 col-sm-offset-2">
                                <input type="hidden" name="id" value="${id}">
                                    <button class="btn btn-primary" type="submit">保存内容</button>
                                    <button class="btn btn-danger" type="button" onclick="history.back()">返回</button>
                                </div>
                            </div>
                        </form>
                 </div>
            </div>
        </div>
    </div>
<#include "/common/footer.html" />  
<script type="text/javascript">
	$(function(){
		$("#updateAuthForm").submit(function(){
			var that = $(this);
			$.ajax({
				url:that.attr("action"),
				type:"post",
				data:that.serialize(),
				dataType:"json",
				success:function(res){
					parent.layer.msg(res.msg)
					setTimeout(function(){
						parent.layer.closeAll();
					}, 1000);
				},
				error:function(){
					
				}
			})
			
			return false;
		})
	})
</script>
</body>
</html>